<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" id="html">
    <head>
        <title></title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <base href="<?= base_url(1); ?>" />
        <link type="text/css" href="css/main.css?v=<?= $config['version'] ?>" rel="stylesheet" />

        <script type="text/css">
            .roleclass { color:#fff;}
            .objectclass { color:#fff;}
        </script>

        <script type="text/javascript">
            //var i = 0;
            function addp()
            {
                var i = $(".autocomplete").length;
                //alert("i = "+i);
                if (i < 4)
                {
                    i++;
                }
                else
                {
                    alert('up to four!');
                    return;
                }
                //alert("i = "+i);
                str = '<p id="p' + i + '">'
                    +'<input type="text" size="39"  placeholder="<?= translate('PLASE_INPUT_ITEM') ?>" '
                    +' name="row[item][]" id="itemid' + i + '" class="autocomplete" table="type_object" autocomplete="off" >'
                    +'<input type="text" size="8" placeholder="<?= translate('PLASE_INPUT_AMOUNT') ?>" '
                    +' name="row[amount][]" id="num' + i + '" >'
//                    +'<?//=translate('MAIL_EQUIPLEVEL')  ?>//'
//                    +'<select name="row[equiplevel][]" id="equiplevel'+i+'" >'
//                    +'<?php //for ($i=0; $i<=10;++$i) { ?>//'
//                    +'<option value="<?//=$i ?>//"><?//=$i ?>//</option>'
//                    +'<?php //}?>//'
//                    +'</select>'
                    +'</p>';
                //alert(" str = "+str);
                $("#add1").append(str);
                autocomplete();

                $("#num"+i).formValidator({empty: false, onshow: '<?= translate('MAIL_TIME_LIMIT_MIN_MAX') ?>'});

            }
            function removep()
            {
                var i = $(".autocomplete").length;
                //alert("i = "+i);
                if (i > 0)
                {
                    $("#p" + i).remove();
                }

            }
            function addm()
            {
                var i = $(".autocomplete").length;
                //alert("i = "+i);
                if (i < 4)
                {
                    i++;
                }
                else
                {
                    alert('up to four!');
                    return;
                }
                //alert("i = "+i);
                str = '<p id="m' + i + '">'
                    +'<input type="text" size="39"  placeholder="<?= translate('PLASE_INPUT_ITEM') ?>" '
                    +' name="row[money_item][]" id="money_id' + i + '" class="autocomplete" table="type_object" autocomplete="off" >'
                    +'<input type="text" size="8" placeholder="<?= translate('PLASE_INPUT_AMOUNT') ?>" '
                    +' name="row[money_amount][]" id="money_num' + i + '" >'
//                    +'<?//=translate('MAIL_EQUIPLEVEL')  ?>//'
//                    +'<select name="row[equiplevel][]" id="equiplevel'+i+'" >'
//                    +'<?php //for ($i=0; $i<=10;++$i) { ?>//'
//                    +'<option value="<?//=$i ?>//"><?//=$i ?>//</option>'
//                    +'<?php //}?>//'
//                    +'</select>'
                    +'</p>';
                //alert(" str = "+str);
                $("#add2").append(str);
                autocomplete();

                $("#money_num"+i).formValidator({empty: false, onshow: '<?= translate('MAIL_TIME_LIMIT_MIN_MAX') ?>'});

            }
            function removem()
            {
                var i = $(".autocomplete").length;
                //alert("i = "+i);
                if (i > 0)
                {
                    $("#m" + i).remove();
                }

            }
        </script>
    </head>
    <body>
        <?php include(VIEWPATH . 'common/main_header.php'); ?>
        <form action="" method="POST" id="rowForm">
            <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tablegrid tableedit">
                <tr><td><?= translate('SELECT_AREA') ?>:</td><td><?= $arealist ?></td></tr>
<!--                <tr><td></td><td><font color='blue'>--><?//= translate('MENU_SEAL_PULL_ONLINE')?><!--</font></td></tr>-->
<!--                <tr><td>--><?//= translate('ROLE_NAME')?><!--:</td><td>-->
<!--                        <input type='text' name="row[role_name]" id='role_name' size='25' value="--><?//= $role_name ?><!--">&nbsp;&nbsp;-->
<!--                        <input type='submit' value="--><?//= translate('MENU_SEAL_PULL_ONLINE_ROLENAME')?><!--" id="submit1"></td></tr>-->
                <tr><td></td><td><font color='blue'><?= translate('MENU_SEAL_PULLROLELEVEL')?></font></td></tr>
                <tr><td><?= translate('SEAL_ROLE_ID') ?>:</td><td><input type="text" name="row[id]" id="id" size="25" value="<?= $role_name ?>"/></td></tr>
                <tr><td><?= translate('ROLE_LEVEL') ?>:</td><td><input type="text" name="row[level]" id="level" size="25" /></td></tr>
                <tr><td><?= translate('ROLE_EXP') ?>:</td><td><input type="text" name="row[exp]" id="exp" size="25" /></td></tr>
                <!-- <tr><td><?= translate('ROLE_VIP_LEVEL') ?>:</td><td><input type="text" name="row[vip_level]" id="vip_level" size="25" /></td></tr>  -->
                <tr><td><?= translate('ROLE_VIP_EXP') ?>:</td><td><input type="text" name="row[vip_exp]" id="vip_exp" size="25" /></td></tr>
                <tr><td><?= translate('ACTION') ?>:</td><td id="add1" size="25">
                        <p id="p">
                            <input type="button" onclick="addp()" value="<?= translate('ADD_ONE') ?>" />
                            <input type="button" onclick="removep()" value="<?= translate('REMOVE_ONE') ?>" />
                        </p>
                    </td></tr>
                <tr><td><?= translate('MONEY') ?>:</td><td id="add2" size="25">
                        <p id="m">
                            <input type="button" onclick="addm()" value="<?= translate('ADD_ONE') ?>" />
                            <input type="button" onclick="removem()" value="<?= translate('REMOVE_ONE') ?>" />
                        </p>
                    </td></tr>
                <tr><td></td><td><input type="submit" value="<?= translate('SUBMIT') ?>" id="submit"/> <input type="reset" value="<?= translate('RESET') ?>" id="reset"/></td></tr>
            </table>
        </form>
        <script type="text/javascript">
            SG.init("core.form", function() {
                $.formValidator.initConfig({formid: "#rowForm", submitonce: true});
                $("#area_host").formValidator({empty: false, onshow: '<?= translate('PLASE_SELECT') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
                $("#role_name").formValidator({empty: false, onshow: '<?= translate('PLASE_INPUT_ROLE_NAME') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});                   
                //$("#gm_command").formValidator({empty: false, onshow: '<?= translate('PLASE_WRITE') ?>'}).inputValidator({min: 1, onerrormin: '<?= translate('C_NOT_EMPTY') ?>'});
            });
        </script>
    </body>
</html>
